#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time    : 2017/5/18 21:38
# @Author  : Beam
# @File    : rabbitmq-广播模式之fanout-publisher.py

import pika

credentials = pika.PlainCredentials('admin', 'admin')   #设置rabbitmq连接账号密码，默认是guest，guest
connection = pika.BlockingConnection(pika.ConnectionParameters('192.168.6.248',5672,'/',credentials))
channel = connection.channel()   #建立连接通道

